package designModel.singleInstance;

public class Singleton_04 {
    //静态成员变量只有一个实例保证线程安全
    private static final Singleton_04 instance = new Singleton_04();

    private Singleton_04() {
    }

    public static Singleton_04 getInstance() {
        return instance;
    }

    public void doSomething() {
        System.out.println(getClass().getSimpleName() + ":无锁的线程安全单例");
    }
}
